# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: Lukas Fleischer <lfleischer@archlinux.org>
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Simon Lipp <sloonz+aur@gmail.com>

pkgname=java-batik
pkgver=1.17
pkgrel=1
pkgdesc='SVG library for Java'
arch=('any')
url='https://xmlgraphics.apache.org/batik/'
license=('APACHE')
depends=('java-runtime' 'java-commons-io' 'java-commons-logging' 'java-xmlgraphics-commons')
makedepends=('java-environment' 'apache-ant' 'unzip')
source=("https://www.apache.org/dist/xmlgraphics/batik/source/batik-src-$pkgver.tar.gz"{,.asc})
sha512sums=('0879f298142630e96931f429ade5e7107d2d981c6c3a99b8f2ddca8e26ea4fde1b7c717d06412c57d64759bed6c5f2d056970d59e19e66caafb926cb30078516'
            'SKIP')
validpgpkeys=('9D5F9D9B3E21B585E8F4551082036989D56B5F17'  # Luis Bernardo
              '5C9A30FF22B2C02F30261C305B93F1DF7CDB6DEA') # Simon Steiner

build() {
  cd batik-$pkgver

  ant all-jar
}

package() {
  install -d "$pkgdir"/usr/share/java/batik
  install -m 644 "$srcdir"/batik-$pkgver/batik-$pkgver/lib/batik-all-$pkgver.jar "$pkgdir"/usr/share/java/batik/batik-all-$pkgver.jar

  ln -s batik-all-$pkgver.jar "$pkgdir"/usr/share/java/batik/batik-all.jar

  cp --no-preserve=ownership "$srcdir/batik-$pkgver/lib"/*.jar "$pkgdir"/usr/share/java/batik/
}

